package jp.sourceforge.akjrcp.util;

import java.io.File;


public class FlowPlayerHtml {


	private String headerHtml="<html>\n<body style='marign=0;padding=0'>\n";
	private String footerHtml="\n</body>\n</html>";
	private String fileName;
	private String fileDir;
	private String swfPath="FlowPlayer.swf";
	public FlowPlayerHtml(String name,String dir){
		this.fileName=name;
		this.fileDir=dir;
		//this.file=new File("c:\\tmp\\movie.flv");
	}
	public String toHTML(){
		StringBuffer str=new StringBuffer();
		
		
		
		str.append(headerHtml);
		str.append("<object type=\"application/x-shockwave-flash\" data=\"FlowPlayer.swf\" width=\"320\" height=\"263\" id=\"FlowPlayer\">\n");
		str.append("<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n");
				str.append("<param name=\"movie\" value=\""+swfPath+"\" />\n");
						str.append("<param name=\"quality\" value=\"high\" />\n");
								str.append("<param name=\"scale\" value=\"noScale\" />\n");
										str.append("<param name=\"wmode\" value=\"transparent\" />\n");
								str.append("<param name=\"flashvars\" value=\"");
								if(fileDir!=null){
								str.append("baseURL="+fileDir+"&amp;");
								}
								str.append(
										"videoFile="+fileName+"&amp;autoPlay=true&amp;bufferLength=5&amp;loop=false&amp;progressBarColor1=0xAAAAAA&amp;progressBarColor2=0x555555&amp;autoBuffering=false&amp;splashImageFile=main_clickToPlay.jpg&amp;hideControls=false\" />\n");
									str.append("</object>\n");
		
		str.append(footerHtml);
		//log.info(str.toString());
		return str.toString();
	}
}
